<template>
  <div id="app">
      <navigation></navigation>
      <searchPro></searchPro>
      <div id="content">
        <router-view/>
      </div>
  </div>
</template>

<script>

import navigation from "./components/navigation.vue"
import searchPro from './components/searchPro.vue'
export default{
  components: {
    navigation, searchPro,
  },
  created(){
    if(sessionStorage.getItem("store")) {
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
          JSON.parse(sessionStorage.getItem("store"))
        )
      );
    }
    window.addEventListener("beforeunload", () => {
      sessionStorage.setItem("store", JSON.stringify(this.$store.state))
    })
  }
}

</script>

<style>

* {
  margin: 0px;
  padding: 0px;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  background-color: rgb(232,232,232);
}

#app a {
  font-weight: normal;
  color: #2c3e50;
  text-decoration: none;
}

#app a.router-link-exact-active {
  color: #c81623;
}

#content {
  width: 1100px;
  margin: 0 auto;
  background-color: rgb(232,232,232); 
  padding-bottom: 20px;
}



</style>

